package com.woniuxy.educationplatform.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * @author unreleased
 * @date 2020/12/8 14:40
 * // @Accessors(chain = true) 开启链式表达
 * //    ResultUtil resultUtil = new ResultUtil().setCode(ResultUtil.SUCCESS);
 */
@Data
@Accessors(chain = true)
@NoArgsConstructor
@AllArgsConstructor
public class ResultUtil<T> {
    /**
     * SUCCESS 成功的固定状态码
     * ERROR   失败的默认状态码
     * code：  状态码
     * message  需要返回的消息
     * T  要返回的数据
     */
    public final static int SUCCESS = 200;
    public final static int ERROR = 10000;
    private int code;
    private String message;
    private T data;
}
